﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HeadCounter.Armourer;
using MathematicallySafe.Base;
using MathematicallySafe.HeadCounter.Common;
using MathematicallySafe.HeadCounter.Data;
using MathematicallySafe.HeadCounter.Data.Models;
using MathematicallySafe.HeadCounter.Services;
using MathematicallySafe.HeadCounter.Services.Backup;
using MathematicallySafe.HeadCounter.Services.Calculators;
using MathematicallySafe.HeadCounter.Services.Exporters;
using MathematicallySafe.HeadCounter.Services.Forums;
using MathematicallySafe.HeadCounter.Services.Publishers;
using StructureMap;
using StructureMap.Configuration.DSL;
using StructureMap.Pipeline;

namespace MathematicallySafe.HeadCounter
{
    public class HeadCounterRegistry: Registry
    {
        public HeadCounterRegistry()
        {
            For(typeof(ILog<>)).Singleton().Use(typeof(Log4NetLog<>));
            For<IUserControlContent>().Use<UserControlContent>();
            For<IActivatableContentContainer>().Singleton().Use<ActivatableContentContainer>();
            For<IArmouryService>().Singleton().Use<ArmouryService>();
            For<ICalculationService>().Use<CalculationService>();
            For<IBackupService>().Use<BackupService>();
            For<IExportService>().Use<ExporterService>();
            For<IForumPostingService>().Singleton().Use<ForumPostingService>();
            For<IForumFormatter>().Use<phpBBFormatter>();  // todo this somewhat defeats the point of the abstraction! Should use named instances or something.
            For<IPublishingService>().Use<Publisher>();
        }
    }
}
